package com.myqm.service.impl.weixin;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.myqm.dao.weixin.InternaltradeDao;
import com.myqm.pojo.weixin.Internaltrade;
import com.myqm.pojo.weixin.query.QueryInternaltrade;
import com.myqm.service.weixin.InternaltradeService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;

@Service
public class InternaltradeServiceImpl implements InternaltradeService{

	@Autowired
	public InternaltradeDao Internaltradedao;
	@Override
	public int delById(Integer id) {
		return Internaltradedao.delById(id);
	}

	@Override
	public int save(Internaltrade record) {
		return Internaltradedao.save(record);
	}

	@Override
	public Internaltrade getById(Integer id) {
		return Internaltradedao.getById(id);
	}


	@Override
	public int editById(Internaltrade record) {
		return Internaltradedao.editById(record);
	}

	@Override
	public PageInfo<Internaltrade> list(int pagenum, int pagesize,QueryInternaltrade param) {
		PageHelper.startPage(pagenum, pagesize);
		List<Internaltrade> datalist = Internaltradedao.list(param.getInternalName(),param.getInternalType());
			 
		PageInfo<Internaltrade> p = new PageInfo<Internaltrade>(datalist);
		return p;
	}

}
